// @RestApi(baseUrl: 'https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/')
import 'package:dio/dio.dart';
import 'package:injectable/injectable.dart';
import 'package:my_desk_flutter/macro/test.dart';
import 'package:my_desk_flutter/net/dio_client.dart';
import 'package:retrofit/http.dart';
import 'package:retrofit/retrofit.dart';
import 'package:my_desk_flutter/model/bus_info_model.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'bus_api.g.dart';

@riverpod
BusApi busApi(BusApiRef ref) => BusApi(ref.read(dioClientProvider));

@RestApi()
@Singleton()
@Repository()
abstract class BusApi {
  @factoryMethod
  factory BusApi(Dio dio) = _BusApi;

  @GET('/Search/LineAndStop/{name}')
  Future<List<BusInfoModel>> searchBusByName({
    @Path('name') required String name,
  });
}
